from django.db import models

# Create your models here.


class users(models.Model):
    id = models.AutoField(primary_key=True)
    name = models.CharField(max_length=255)
    student_id = models.IntegerField()
    password = models.CharField(max_length=255)
    age = models.IntegerField()
    student_img = models.CharField(max_length=255)
    phone = models.CharField(max_length=255)
    class_name = models.CharField(max_length=255)
    state = models.CharField(max_length=255)
    create_time = models.DateTimeField(auto_now_add=True)
    update_time = models.DateTimeField(auto_now=True)

    class Meta:
        db_table = "user"

# Create your models here.


class categorys(models.Model):
    id = models.AutoField(primary_key=True)
    category_name = models.CharField(max_length=255)
    create_time = models.DateTimeField(auto_now_add=True)
    update_time = models.DateTimeField(auto_now=True)

    class Meta:
        db_table = "categorys"


class collects(models.Model):
    id = models.AutoField(primary_key=True)
    goods_id = models.IntegerField()
    user_id = models.IntegerField()
    create_time = models.DateTimeField(auto_now_add=True)
    update_time = models.DateTimeField(auto_now=True)

    class Meta:
        db_table = "collects"


class comments(models.Model):
    id = models.AutoField(primary_key=True)
    content = models.CharField(max_length=255)
    user_id = models.IntegerField()
    goods_id = models.IntegerField()
    two_id = models.IntegerField()
    is_delet = models.IntegerField()
    create_time = models.DateTimeField(auto_now_add=True)
    update_time = models.DateTimeField(auto_now=True)

    class Meta:
        db_table = "comments"


class goods(models.Model):
    id = models.AutoField(primary_key=True)
    name = models.CharField(max_length=255)
    goods_img = models.CharField(max_length=255)
    price = models.CharField(max_length=255)
    category_id = models.IntegerField()
    is_delet = models.IntegerField()
    release_time = models.DateTimeField(null=True)
    user_id = models.IntegerField()
    click_count = models.IntegerField()
    state = models.IntegerField()
    fineness = models.IntegerField()
    review_status = models.IntegerField()
    create_time = models.DateTimeField(auto_now_add=True)
    update_time = models.DateTimeField(auto_now=True)

    class Meta:
        db_table = "goods"


class likes(models.Model):
    id = models.AutoField(primary_key=True)
    user_id = models.IntegerField()
    goods_id = models.IntegerField()
    is_like = models.IntegerField()
    create_time = models.DateTimeField(auto_now_add=True)
    update_time = models.DateTimeField(auto_now=True)

    class Meta:
        db_table = "likes"


class orders(models.Model):
    id = models.AutoField(primary_key=True)
    goods_id = models.IntegerField()
    seller_id = models.IntegerField()
    buyer_id = models.IntegerField()
    state = models.IntegerField()
    days = models.IntegerField()
    lease_time = models.DateTimeField()
    order_num = models.CharField(max_length=255)
    create_time = models.DateTimeField(auto_now_add=True)
    update_time = models.DateTimeField(auto_now=True)

    class Meta:
        db_table = "orders"
